package com.baohulu.baohulu.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

import com.baohulu.baohulu.R;
import com.baohulu.baohulu.common.Const;
import com.baohulu.baohulu.utils.TimeUtil;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 结算界面
 */
public class PayActivity extends AppCompatActivity {
    @BindView(R.id.tv_cost)
    TextView mTvCost;
    @BindView(R.id.tv_rented_time)
    TextView mTvRentedTime;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pay);
        ButterKnife.bind(this);
        long rentTime = getIntent().getLongExtra(Const.Extra.RENT_TIME, 0);
        double totalCost = getIntent().getDoubleExtra(Const.Extra.TOTAL_COST, 0);
        String costStr = totalCost + "元";
        String timeStr = TimeUtil.formatTime(rentTime);
        mTvCost.setText(costStr);
        mTvRentedTime.setText(timeStr);
    }

    @OnClick(R.id.btn_pay)
    public void pay() {
        finish();
    }
}
